package com.chixing.day08_interface.word;

public class Product implements Cloneable {
    private int productId;
    private String productName;

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Product(){}
    public Product(int productId, String productName) {
        this.productId = productId;
        this.productName = productName;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Product cloneproduct = new Product();
        cloneproduct.productId = this.productId;
        cloneproduct.productName = this.productName;
        return cloneproduct;
    }

    @Override
    public String toString() {
        return "Product{" +
                "productId=" + productId +
                ", productName='" + productName + '\'' +
                '}';
    }
}
